home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1995 #5 & #6 / Amiga Plus CD - 1995 - No. 5 and 6.iso / pd / serien / purity / nr.42 / includes3v1 / includes3v1.lha / Exec / IO.i < prev    next >
Text File  |  1994-12-04  |  2KB  |  92 lines

  1. {
  2.      IO.i for PCQ Pascal
  3.  
  4.     This file defines the constants and types required to use
  5.     Amiga device IO routines, which are also defined here.
  6. }
  7.  
  8. {$I "Include:Exec/Ports.i"}
  9.  
  10. type
  11.     IORequest = record
  12.     io_Message    : Message;
  13.     io_Device    : Address;        { device node pointer  }
  14.     io_Unit        : Address;        { unit (driver private)}
  15.     io_Command    : Short;        { device command }
  16.     io_Flags    : Byte;
  17.     io_Error    : Byte;            { error or warning num }
  18.     end;
  19.     IORequestPtr = ^IORequest;
  20.  
  21.     IOStdReq = record
  22.     io_Message    : Message;
  23.     io_Device    : Address;        { device node pointer  }
  24.     io_Unit        : Address;        { unit (driver private)}
  25.     io_Command    : Short;        { device command }
  26.     io_Flags    : Byte;
  27.     io_Error    : Byte;            { error or warning num }
  28.     io_Actual    : Integer;        { actual number of bytes transferred }
  29.     io_Length    : Integer;        { requested number bytes transferred}
  30.     io_Data        : Address;        { points to data area }
  31.     io_Offset    : Integer;        { offset for block structured devices }
  32.     end;
  33.     IOStdReqPtr = ^IOStdReq;
  34.  
  35.  
  36. { library vector offsets for device reserved vectors }
  37.  
  38. const
  39.     DEV_BEGINIO    = -30;
  40.     DEV_ABORTIO    = -36;
  41.  
  42. { io_Flags defined bits }
  43.  
  44.     IOB_QUICK    = 0;
  45.     IOF_QUICK    = 1;
  46.  
  47.     CMD_INVALID    = 0;
  48.     CMD_RESET    = 1;
  49.     CMD_READ    = 2;
  50.     CMD_WRITE    = 3;
  51.     CMD_UPDATE    = 4;
  52.     CMD_CLEAR    = 5;
  53.     CMD_STOP    = 6;
  54.     CMD_START    = 7;
  55.     CMD_FLUSH    = 8;
  56.  
  57.     CMD_NONSTD    = 9;
  58.  
  59. {
  60.     These functions are defined to accept Address's, because they
  61.     need to handle IORequestPtrs and IOStdReqPtrs, and I wanted
  62.     to avoid all those type conversions
  63. }
  64.  
  65. Function AbortIO(io : Address) : Integer;
  66.     External;
  67.  
  68. Procedure BeginIO(io : Address);
  69.     External;
  70.  
  71. Function CheckIO(io : Address) : Address;
  72.     External;
  73.  
  74. Function DoIO(io : Address) : Integer;
  75.     External;
  76.  
  77. Procedure SendIO(io : Address);
  78.     External;
  79.  
  80. Function WaitIO(io : Address) : Integer;
  81.     External;
  82.  
  83.  
  84. { - 2.0 functions - }
  85.  
  86. Function CreateIORequest( mp : MsgPortPtr; size : Integer ): Address;
  87.     External;
  88.  
  89. Procedure DeleteIORequest( iorq : address );
  90.     External;
  91.  
  92.